<template>
	<div>
		<!--轮播图-->
		<mt-swipe :auto="4000">
			<mt-swipe-item v-for="(img, index) in imgs" :key="index">
				<a :href="img.url"><img :src="img.img" /></a>
			</mt-swipe-item>
		</mt-swipe>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				imgs: []
			};
		},
		props:['url'],
		created() {
			try {
				this.$axios.post(this.url).then(res => {
					this.imgs = res.data;
				}).catch(function(error) {
					console.log(error);
				});
			} catch(err) {
				alert(err)
			}
		}
	}
</script>

<style scoped>
	/*轮播图高度*/
	
	.mint-swipe {
		height: 180px;
	}
	/*轮播图宽度、高度*/
	
	.mint-swipe img {
		width: 100%;
		height: 100%;
	}
</style>